/**
 * @file        line_parser.hpp
 * @brief       Implements line parsing functionality.
 *
 * @author      Emre Turkay <emreturkay at gmail>
 * @date        Jun.01.2008
 *
 * Copyright Emre Turkay 2009
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file COPYRIGHT or copy at
 * http://www.boost.org/LICENSE_1_0.txt)
 */

#ifndef _LINE_PARSER_HPP_
#define _LINE_PARSER_HPP_

#include <boost/optional.hpp>

#include <iostream>
#include <string>
#include <cctype>
#include <set>

/**
 * Action item factory function object.
 *
 * Reads the given istream line by line, parses each line and produces
 * gtd action items.
 */
struct line_parser
{
    struct result_type
    {
        boost::optional<std::string> project;
        std::set<std::string> contexts;
        std::string description;
    };

    static boost::optional<result_type> parse(const std::string& line);
};

#include "line_parser.ipp"

#endif // _LINE_PARSER_HPP_
